package com.account.book.service;

import com.account.book.common.response.BaseResult;
import com.account.book.entity.BookUser;
import com.account.book.request.BookUserQueryReqVo;
import com.account.book.request.UserApplyBookReqVo;
import com.account.book.response.BookUserQueryVo;
import com.account.book.response.BookUserResVo;
import com.account.book.vo.BookUserEditVo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 * 账本用户表 服务类
 * </p>
 *
 * @author wky
 * @since 2022-04-02
 */
public interface BookUserService extends IService<BookUser> {

    /**
     * 查询账本下的用户列表
     *
     * @param bookId
     * @return
     */
    BookUserResVo getBookUser(String bookId);

    /**
     * @param @param bookId
     * @return @return {@link Boolean }
     * @author liang-hw
     * @description 判断用户是否有该账本权限
     * @date 2024/01/10 11:24:27
     */
    BookUserQueryVo isBookAuthor(String bookId, String userId);

    /**
     * @param @param bookId
     * @return @return {@link BookUserQueryVo }
     * @author liang-hw
     * @description 查询账本下的用户信息
     * @date 2023/12/04 16:48:37
     */
    BookUserQueryVo getBookUserInfo(String bookId, String userId);

    /**
     * @param @param bookUserQueryReqVo
     * @return
     * @author liang-hw
     * @description 修改当前账本预算
     * @date 2024/01/10 16:45:33
     */
    void editBudget(BookUserQueryReqVo bookUserQueryReqVo, String userId);

    /**
     * @param @param bookId
     * @param userId
     * @return @return {@link BaseResult }
     * @author liang-hw
     * @description
     * @date 2023/11/09 10:29:54
     */
    void addAuth(String bookId, String editUserId, String userId);

    /**
     * 移除管理员
     *
     * @param bookId
     * @param userId
     * @return
     */
    void removeAuth(String bookId, String editUserId, String userId);

    /**
     * 删除成员
     *
     * @param bookId
     * @param userId
     * @return
     */
    void remove(String bookId, String editUserId, String userId);

    /**
     * 编辑成员
     *
     * @param bookUserEditVo
     * @return
     */
    void editBookUser(BookUserEditVo bookUserEditVo);


    void update(BookUserEditVo bookUserEditVo);

    void signOutBook(String bookId, String userId);

    /**
     * 查询账本申请加入的用户
     */
    BookUserResVo bookAudit(String bookId);

    void reject(UserApplyBookReqVo userApplyBookReqVo, String userId);

    void agree(UserApplyBookReqVo userApplyBookReqVo, String userId);

    Integer getAuditCount(String userId);

    List<BookUserQueryVo> getAuditAll(String userId);

    List<BookUserQueryVo> myApply(String userId);

    List<BookUserResVo> replaceList(String bookId);

    BookUserResVo sendApply(UserApplyBookReqVo userApplyBookReqVo, String userId);

    BookUserQueryVo getBookOne(String bookId, String userId);

}
